/**********************************************************************
 Copyright (C) 2009 Jaakko Vuori

 This file is part of FlexiWorker.
 For more information, see <http://code.google.com/p/flexi-worker/>

 FlexiWorker is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 FlexiWorker is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with FlexiWorker.  If not, see <http://www.gnu.org/licenses/>.
 **********************************************************************/

#ifndef FLEXIVIEWERWINDOW_H
#define FLEXIVIEWERWINDOW_H

#include <QtGui/QMainWindow>

#include "presencelogmodel.h"

namespace Ui
{
    class FlexiViewerWindowClass;
}

class TimeLineWidget;
class QLabel;

class DayRow
{
public:
    TimeLineWidget* m_timeLineWidget;
    QLabel* m_dateLabel;
    QLabel* m_workTimeLabel;
};

class FlexiViewerWindow : public QMainWindow
{
    Q_OBJECT

public:
    FlexiViewerWindow(QWidget *parent = 0);
    ~FlexiViewerWindow();

private slots:
    void on_actionPreviousWeek_triggered();
    void on_actionNextWeek_triggered();

private slots:
    void updateWorkingTime(TimeLineWidget* timeLineWidget, TimeFrame workingTime);

private:
    void updateDay(int dayInPeriod);
    void updateWeek();

private:
    Ui::FlexiViewerWindowClass *ui;
    PresenceLogModel m_model;
    QDate m_weekStartDate;
    QList<DayRow> m_dayRows;
    //QList<TimeLineWidget*> m_timeLineWidgets;
    //QList<QLabel*> m_dateLabels;
    //QList<QLabel*> m_workTimeLabels;
};

#endif // FLEXIVIEWERWINDOW_H
